<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ include file="/WEB-INF/jsp/common/taglib.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Index</title>
<link href="<s:url value="/css/standard.css" />" rel="stylesheet"
	type="text/css" />
<link href="<s:url value="/css/pop_up.css" />" rel="stylesheet"
	type="text/css" />
<link href="<s:url value="/css/maintenance.css" />" rel="stylesheet"
	type="text/css" />
<link href="<s:url value="/css/Simplemodal.css" />" rel="stylesheet"
	type="text/css" />

<script src='<c:url value="/js/common.js" />'></script>
<script src='<c:url value="/js/common_ui.js" />'></script>
<script src='<c:url value="/js/poplayer.js" />'></script>
<script src='<c:url value="/js/maint_ui.js" />'></script>
<script src='<c:url value="/js/jquery.DynamicMessage.js" />'></script>
<script src='<c:url value="/js/jquery.simplemodal-1.4.1.js" />'></script>
<script src='<c:url value="/js/jquery-1.7.2.js" />'></script>

</head>
<body>
	<script>
	function deleteDemo(id){
		if(confirm("Are you sure to delete this Record?")){
			$('#id').val(id);
			deleteForm.action="<c:url value='/employeeinfo/'/>" + id ;
			deleteForm.submit();
		}
	}
</script>
	<form:form name="deleteForm" method="delete">
		<input type="hidden" name="id">
	</form:form>
	<div class="search">
		<form:form action="/employeeInfo/search" method="get">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>Name:<input type="text" value="">
					Gender: <select>
							<option value="ALL" selected="selected">ALL</option>
							<option value="Man">Man</option>
							<option value="female">Woman</option>
					</select>
					<input type='submit' value=' Search '/>
					</td>
				</tr>
			</table>
		</form:form>
	</div>

	<div class="Info">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="7" align="left" valign="top" height="7"><img
					src="<s:url value="/images/corner_left_top_m.gif"/>" width="7"
					height="7" /></td>
				<td class="topBorderMain"><img
					src="<s:url value="/images/spacer.gif" />" /></td>
				<td width="7" align="right" valign="top"><img
					src="<s:url value="/images/corner_right_top_m.gif" />" /></td>
			</tr>

			<tr>
				<th colspan="4" class="mainFormTitle">EmployeeInfo</th>
			</tr>
			<tr>
				<td colspan="4" class="leftRightBorderMain">

					<table cellpadding="0" cellspacing="0" class="invoiceButton">
						<tr>
							<td><img src="<s:url value="/images/btn_add.gif"/>"
								name="btn_add.gif" align="absbottom" /> <a
								href="javascript:location.href='<c:url value='/employeeinfo/add' />'">Add
									New </a></td>
						</tr>
					</table>
					<table id="radiotable" class="mainGrid" width="100%" border="0"
						cellpadding="0" cellspacing="0">
						<thead>
							<tr>
								<th width='20%'>id</th>
								<th width='10%'>name</th>
								<th width='20%'>grender</th>
								<th width='10%'>title</th>
								<th width='20%'>tel</th>
								<th width='20%'>address</th>
								<th  width='20%'>control</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${ list }" var="employee" varStatus="status">
								<tr id="radiotable_tr_<c:out value="${status.index}"/>">
									<td align='center'>
									<a href="javascript:location.href='<c:url value='/employeeinfo/${ employee.id }/view' />'">
									<c:out value="${ employee.id }" /></a></td>
												
									<td align='center'><c:out value="${ employee.name }" /></td>
									<td align='center'><c:out value="${ employee.grender }" /></td>
									<td align='center'><c:out value="${ employee.title }" /></td>
									<td align='center'><c:out value="${ employee.tel }" /></td>
									<td align='center'><c:out value="${ employee.address }" /></td>
									
									<td align='center' style="white-space: nowrap;">
									<a href="javascript:void(0);"
										onclick="location.href='<c:url value='/employeeinfo/${ employee.id }/edit' />'"><img
											src="<s:url value="/images/btn_edit.gif"/>"
											name="btn_edit.gif" alt="Edit" title="Edit" width="18"
											height="20" hspace="3" vspace="3" border="0"
											align="absmiddle" /></a> 
											
											<a href="javascript:void(0);"
										onclick="deleteDemo('<c:out value='${ employee.id }'/>')"><img
											src="<s:url value="/images/btn_remove.gif"/>"
											name="btn_remove.gif" alt="Remove" title="Remove" width="18"
											height="20" hspace="3" vspace="3" border="0"
											align="absmiddle" /></a></td>
								</tr>
							</c:forEach>

							<c:if test="${ list == null || fn:length(list) == 0}">
								<tr id="radiotable_tr_<c:out value="${status.index}"/>">
									<td colspan='99' align='center'><font color='red'>no
											recored.</font></td>
								</tr>
							</c:if>
						</tbody>
					</table>
				</td>
			</tr>
			<tr>
				<th colspan="4" class="mainFormbtn">
					<table cellpadding="0" cellspacing="0" width="100%">
						<tr>
							<td align="center">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td align="center">&nbsp;</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</th>
			</tr>
			<tr>
				<td align="left" valign="bottom" height="7" width="7"><img
					src="<s:url value="/images/corner_left_bottom_m.gif"/>" /></td>
				<td class="bottomBorderMain"><img
					src="<s:url value="/images/spacer.gif"/>" /></td>
				<td align="right" valign="bottom" height="7" width="7"><img
					src="<s:url value="/images/corner_right_bottom_m.gif"/>" /></td>
			</tr>
		</table>
	</div>
</body>
</html>